package com.itheima.sercive.CheckItemServiceImpl;

import com.itheima.mapper.CheckGroupMapper;
import com.itheima.pojo.CheckGroup;
import com.itheima.sercive.checkGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class checkGroupServiceImpl implements checkGroupService {
    @Autowired
    private CheckGroupMapper checkGroupMapper;

 /**
 * 添加检查组
 * @param checkGroup
 */
    public void add(CheckGroup checkGroup) {
        checkGroupMapper.add(checkGroup);
    }
/**
 * 删除检查组
 * @param id
 */
    @Override
    public void deleteById(Integer id) {
        checkGroupMapper.deleteById(id);
    }
/**
 * 查询所有检查组
 * @return
 */
    @Override
    public List<CheckGroup> findAll() {
        List<CheckGroup> list = checkGroupMapper.findAll();
        return list;
    }
/**
 * 根据id查询检查组
 * @param id
 * @return
 */
    @Override
    public CheckGroup findById(Integer id) {
        return checkGroupMapper.findById(id);
    }
/**
 * 修改检查组
 * @param checkGroup
 */
    @Override
    public void update(CheckGroup checkGroup) {

        checkGroupMapper.update(checkGroup);
    }
/**
 * 分页查询
 * @param queryString
 * @return
 */
    @Override
    public List<CheckGroup> findPage(String queryString) {
        return checkGroupMapper.findPage(queryString);
    }
/**
 * 根据检查套餐id查询检查组id
 * @param setmealId
 * @return
 */
    @Override
    public List<Integer> findCheckGroupBySetmealId(Integer setmealId) {
        return checkGroupMapper.findCheckGroupBySetmealId(setmealId);
    }
}
